//
//  AddScheduleTask.m
//  iphone.mobileoa
//
//  Created by 李亚春 on 13-6-24.
//  Copyright (c) 2013年 Epoint. All rights reserved.
//

#import "AddScheduleTask.h"
#import "WebServiceHelper.h"
#import "StringUtil.h"

@implementation AddScheduleTask

-(void)execute
{
    NSString *ValidateData = [self.params objectForKey:@"ValidateData"];
    NSString *url = [self.params objectForKey:@"url"];
    NSString *wsNamespace = [self.params objectForKey:@"namespace"];
    NSString *userguid = [self.params objectForKey:@"userguid"];
    
    NSString *FromDateTime = [self.params objectForKey:@"FromDateTime"];
    NSString *ToDateTime = [self.params objectForKey:@"ToDateTime"];
    NSString *Subject = [self.params objectForKey:@"Subject"];
    
    NSString *Location = [self.params objectForKey:@"Location"];
    
    NSString *Importance = [self.params objectForKey:@"Importance"];
    
    NSString *ActivityDescription = [self.params objectForKey:@"ActivityDescription"];
    
    NSString *IFNotice = [self.params objectForKey:@"IFNotice"];
    
    NSString *SendTime = [self.params objectForKey:@"SendTime"];
    
    WebServiceHelper *webserviceHelper = [[WebServiceHelper alloc]initWebServiceWithUrl:url wsNamespace:wsNamespace method:@"Schedule_Add"];
    
    NSString *ParasXml = @"<?xml version=\"1.0\" encoding=\"gb2312\"?><paras><UserGuid>%@</UserGuid><Subject>%@</Subject><Location>%@</Location><Importance>%@</Importance><ActivityDescription>%@</ActivityDescription><FromDateTime>%@</FromDateTime><ToDateTime>%@</ToDateTime><ReceivePhone>%@</ReceivePhone><SendTime>%@</SendTime><IFNotice>%@</IFNotice></paras>";
    ParasXml = [NSString stringWithFormat:ParasXml,userguid,Subject,Location,Importance,ActivityDescription,FromDateTime,ToDateTime,@"",SendTime,IFNotice];
    ParasXml = [StringUtil filterXmlString:ParasXml];
    [webserviceHelper addParameterForString:@"ValidateData" value:ValidateData];
    [webserviceHelper addParameterForString:@"ParasXml" value:ParasXml];
    NSString *bs = webserviceHelper.start;
    [self sendDataRefreshUI:bs];
}

@end
